<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>我的</title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta name="viewport" content="width=device-width, user-scalable=no">
		<meta content="yes" name="apple-mobile-web-app-capable">
		<meta name=”apple-mobile-web-app-status-bar-style” content=”default” />
		<meta name=”apple-mobile-web-app-status-bar-style” content=”black” />
		<meta name=”apple-mobile-web-app-status-bar-style” content=”black-translucent” />
		<meta content="telephone=no" name="format-detection">
		<meta content="email=no" name="format-detection">
		<meta name="format-detection" content="telephone=no"/>
		<link href="${s.base}/mobile/css/weui.min.css" rel="stylesheet"/>
		<link href="${s.base}/mobile/css/jquery-weui.css" rel="stylesheet">
		<link rel="stylesheet" href="${s.base}/mobile/css/wbNew.css" />
		<script type="text/javascript" src="${s.base}/mobile/js/fontSize.js"></script>
	</head>
	<body>
		<div class="main-content75" style="background:#f4f4f4;">
			<div class="mine-ctn">
				<div class="mine-top">
					<div class="userAvatar" style="background:url(${wxMember.headLogo}) center no-repeat;background-size:cover;"></div>
					<h1 class="mart20">${wbUser.name} [<#if wbUser.type=='1'>用户</#if><#if wbUser.type=='2'>分配人</#if><#if wbUser.type=='3'>维修人</#if><#if wbUser.type=='4'>巡检员</#if>]</h1>
					<h2>手机：${wbUser.phone}</h2>
				</div>
				<div class="cont-block mart40 pad20">
					<div class="mine-task-tit">我的维修任务<div onclick="repairList(0)" class="mine-task-more">查看更多<i class="cyfont">&#xe60e;</i></div></div>
					<div class="mine-task-list clearfix">
						<ul>
							<li>
								<div class="mine-task-pic" onclick="repairList(1)"><img src="${s.base}/mobile/images/wb/dfp.png"><#if dfpNum gt 0 > <div class="numeNews">${dfpNum}</div></#if></div><h1>待分配</h1>
							</li>
							<li>
								<div class="mine-task-pic" onclick="repairList(2)"><img src="${s.base}/mobile/images/wb/dwx.png"><#if dwxNum gt 0 > <div class="numeNews">${dwxNum}</div></#if></div><h1>待维修</h1>
							</li>
							<li>
								<div class="mine-task-pic" onclick="repairList(4)"><img src="${s.base}/mobile/images/wb/ywx.png"><#if dqrNum gt 0 > <div class="numeNews">${dqrNum}</div></#if></div><h1>待确认</h1>
							</li>
							<li>
								<div class="mine-task-pic" onclick="repairList(5)"><img src="${s.base}/mobile/images/wb/yfx.png"><#if ywcNum gt 0 > <div class="numeNews">${ywcNum}</div></#if></div><h1>已完成</h1>
							</li>
						</ul>
					</div>
					<#if lastRepairList?? && (lastRepairList?size gt 0)>
					<div class="mine-service-news clearfix">
						<div class="swiper-container" id="wbService">
							<div class="swiper-wrapper">
								<#list lastRepairList as lastRepair>
								<div class="swiper-slide">
									<a href="/phone/wb/repairDetail?token=${token}&applyId=${applyId}&id=${lastRepair.id}" style="width:calc(100% - 0.4rem);padding:0 0.2rem">
									<div style="text-align: left; line-height:1;">
										<div class="mine-service-news-tit clearfix">
											<div class="left-service-news-tit">${lastRepair.deviceName}</div>
											<div class="right-service-news-time">${lastRepair.updateTime?string('yyyy-MM-dd')}</div>
										</div>
										<div class="mine-service-news-list">
											<div class="mine-service-news-pic" style="background:url(/mobile/images/news.png) center no-repeat;background-size:cover;"></div>
											<div class="div-service-type"><i class="cyfont">&#xe699;</i>
												<#if lastRepair.status == '1'>待分配</#if>
												<#if lastRepair.status == '2'>待维修</#if>
												<#if lastRepair.status == '3'>已返修</#if>
												<#if lastRepair.status == '4'>待确认</#if>
												<#if lastRepair.status == '5'>已完成</#if>
											</div>
											<div class="div-service-txt ellipsis">${lastRepair.description}</div>
										</div>
									</div>
									</a>
								</div>
								</#list>

							</div>			
						</div>
						
					</div>
					</#if>
				</div>
				<div class="cont-block mart20">
					<div class="mine-column-list">
						<ul>
							<li><a href="/phone/wb/assignmentList?token=${token}&applyId=${applyId}&status=1"> <div class="mine-column-label"><i class="cyfont">&#xe60a;</i></div>等待分配<div class="mine-column-more"><i class="cyfont">&#xe60e;</i></div></a></li>
							<li><a href="/phone/wb/assignmentList?token=${token}&applyId=${applyId}&status=2"><div class="mine-column-label"><i class="cyfont">&#xe60c;</i></div>待维修<div class="mine-column-more"><i class="cyfont">&#xe60e;</i></div></a></li>
							<!--<li><div class="mine-column-label"><i class="cyfont">&#xe6d4;</i></div>巡检记录<div class="mine-column-more"><i class="cyfont">&#xe60e;</i></div></li>
							<li><div class="mine-column-label"><i class="cyfont">&#xe674;</i></div>客服<div class="mine-column-more"><i class="cyfont">&#xe60e;</i></div></li>
		-->				</ul>
					</div>
				</div>
				<div class="cont-block mart20">
					<div class="mine-column-list">
						<ul>
							<li><a href="/phone/wb/mySet?token=${token}&applyId=${applyId}"><div class="mine-column-label"><i class="cyfont">&#xe607;</i></div>个人信息<div class="mine-column-more"><i class="cyfont">&#xe60e;</i></div></a></li>
							<li id="exit"><div class="mine-column-label"><i class="cyfont">&#xe65a;</i></div>退出<div class="mine-column-more"><i class="cyfont">&#xe60e;</i></div></li>
						</ul>
					</div>
				</div>
			</div>
		</div>
		<!-- 底部菜单开始-->
		<div class="circle-ment-ctn"></div>
		<div class="circle-ment-ctn-mini" onclick="saoma()"><i class="cyfont">&#xe601;</i></div>
		<div class="wb-bot-fixed">
			<ul>
				<li >
					<a href="/phone/wb/index?token=${token}&applyId=${applyId}">
					<div class="wb-bot-menupic">
						<i class="cyfont">&#xe665;</i>
					</div>
					<h2>首页</h2>
					</a>
				</li>
				<li>
					
					<div onclick="saoma()" class="wb-bot-menupic"></div>
					<h2 onclick="saoma()" >扫一扫维修</h2>
				</li>
				<li class="checked">
					<a href="/phone/wb/my?token=${token}&applyId=${applyId}">
					<div class="wb-bot-menupic">
						<i class="cyfont">&#xe610;</i>
					</div>
					<h2>我的</h2>
					</a>
				</li>
			</ul>
		</div>
		<!-- 底部菜单结束-->
	</body>

	<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
	<script type="text/javascript" src="${s.base}/mobile/js/jquery-2.1.4.min.js"></script>
	<script type="text/javascript" src="${s.base}/mobile/js/common.js"></script>

	<!--js分享代码开始-->
	<input type="hidden" value="${jSTicketShareResponse.appid}" id="appid" />
	<input type="hidden" value="${jSTicketShareResponse.fxTitle}" id="fxTitle" />
	<input type="hidden" value="${jSTicketShareResponse.fxImgUrl}" id="fxImgUrl" />
	<input type="hidden" value="${jSTicketShareResponse.fxDesc}" id="fxDesc" />
	<input type="hidden" value="${jSTicketShareResponse.fxUrl}" id="fxUrl" />
	<input type="hidden" value="${jSTicketShareResponse.nonceStr}" id="nonceStr" />
	<input type="hidden" value="${jSTicketShareResponse.timestamp}" id="timestamp" />
	<input type="hidden" value="${jSTicketShareResponse.signature}" id="signature" />
	<script src="${s.base}/mobile/js/share.js"></script>
	<script>

		function repairList(status) {
			window.location.href="/phone/wb/repairList?token="+token+"&applyId="+applyId+"&status="+status;
        }

        var token = '${token}';
        var applyId = '${applyId}';
        var userId='${wbUser.id}';
        // 退出
        $("#exit").on("click",function () {
            $.confirm("确定退出吗？","提示",function(){
                $.fn.doPost('/phone/wb/exit', {userId:userId}, function (result) {
                    if (result.code == 0){
                        window.location.href = "/phone/wb/login?token="+token+"&applyId="+applyId;
                    }else {
                        $.toast(result.msg,"text");
                    }
                });
			})

        });
        function saoma() {
            scanQRCode(function(result) {
                if((result.indexOf("&") > -1)){
                    var parmas=result.split("&");
                    if(parmas[1]=='1'){
                        window.location.href="/phone/wb/saceRepair?token="+token+"&applyId="+applyId+"&roomId="+parmas[0];
                    }else{
                        window.location.href="/phone/wb/saceRepair?token="+token+"&applyId="+applyId+"&devicesId="+parmas[0];
                    }
                }else {
                    $.toast("二维码格式有误", "text");
                }

            });
        }
	</script>
</html>
